package com.us.usws.common;

import net.iwsh.core.common.GlobalConfig;

/**
 * Site constants
 */
public class SiteConstants {

	/*----------------------- configuration constants -----------------------------*/
	//for debug mode
	public static final boolean IS_DEBUG;
	public static final String AUTO_LOGIN_NAME;

	//page constants
	public static final int DFT_WEB_PAGE_SIZE, DFT_WS_PAGE_SIZE, DFT_VIDEO_RECOMMEND_NUM, DFT_MEETING_PAGE_SIZE;

	//web service constants
	public static final String WS_HEADER_USERID_NAME, WS_HEADER_TOKEN_NAME;

	static {
		//debug and auto login
		IS_DEBUG = GlobalConfig.getBoolean("Commons/DebugMode", false);
		AUTO_LOGIN_NAME = GlobalConfig.getString("Commons/AutoLoginName", "admin");
		WS_HEADER_USERID_NAME = GlobalConfig.getString("WSParams/HeaderBoxsnName", "userid");
		WS_HEADER_TOKEN_NAME = GlobalConfig.getString("WSParams/HeaderTokenName", "access-token");

		DFT_WEB_PAGE_SIZE = GlobalConfig.getInt("WebPage/DefaultPageSize", 20);
		DFT_WS_PAGE_SIZE = GlobalConfig.getInt("WSPage/DefaultPageSize", 25);
		DFT_MEETING_PAGE_SIZE = GlobalConfig.getInt("WSPage/DefaultMeetingPageSize", 25);
		DFT_VIDEO_RECOMMEND_NUM = GlobalConfig.getInt("WSPage/DefaultRecommendVideoNum", 5);
	}

	/*----------------------- immutable constants -----------------------------*/
	/**
	 * boolean true/false in DB -- we store char(1) in DB.
	 */
	public static final String STR_BOOLEAN_YES = "Y";
	public static final String STR_BOOLEAN_NO = "N";

	/**
	 * login constants
	 */
	public static final String SESSION_KEY_LOGIN_USER = "user";
	public static final String SESSION_KEY_IPODIUM_USER = "ipodium_user";
	public static final String SESSION_KEY_ORIGINAL_URL = "requestURLBeforeLogin";
	public static final String SESSION_KEY_SSO_USER = "com.us.sso.client.filter.user";

	/**
	 * service factory type
	 */
	public static final String SERVICE_FACTORY_TYPE_WSDL = "WSDL";
	public static final String SERVICE_FACTORY_TYPE_DIRECT = "DIRECT";
	public static final String SERVICE_FACTORY_TYPE_REST = "REST";
	public static final String SERVICE_FACTORY_TYPE_HESSIAN = "HESSIAN";
	public static final String SERVICE_FACTORY_TYPE_GUICE = "GUICE";

	/**
	 * channel consts
	 */
	public static final String CHANNEL_ROOT_UID = "/";

	public static final int CHANNEL_TARGET_ROLE_STUDENT = 1;
	public static final int CHANNEL_TARGET_ROLE_PARENT = 2;
	public static final int CHANNEL_TARGET_ROLE_PUBLIC = 4;
	public static final int CHANNEL_TARGET_ROLE_TEACHER = 8;
	public static final int CHANNEL_TARGET_ROLE_ALL = 0;

	public static final int CHANNEL_VIDEO_QUALITY_POSITIVE = 1;
	public static final int CHANNEL_VIDEO_QUALITY_PREVUE = 2;

	public static final int CHANNEL_VIDEO_FROM_ADMIN = 1;
	public static final int CHANNEL_VIDEO_FROM_MEMBER = 2;

	public static final int CHANNEL_MEETING_TYPE_ONLINE_TUTORING = 1;
	public static final int CHANNEL_MEETING_TYPE_NETWORK_CLASSROOM = 2;
	public static final int CHANNEL_MEETING_TYPE_PARENT_MEETING = 4;
	public static final int CHANNEL_MEETING_TYPE_PARENT_INTERVIEW = 8;

	public static final int CHANNEL_MEETING_STATUS_ORDER = 1;
	public static final int CHANNEL_MEETING_STATUS_STARTING = 2;
	public static final int CHANNEL_MEETING_STATUS_OVER = 4;

	/**
	 * System Object type define
	 */
	public static final long SYSOBJ_ROOT_ID = 1L;

	public static final String SYSOBJ_TYPE_MODULE = "D";
	public static final String SYSOBJ_TYPE_MENU = "M";
	public static final String SYSOBJ_TYPE_PAGE = "P";
	public static final String SYSOBJ_TYPE_BUTTON = "B";
	public static final String SYSOBJ_TYPE_JAVASCRIPT = "J";
	public static final String SYSOBJ_TYPE_HYPERLINK = "L";
	public static final String SYSOBJ_TYPE_IMAGE = "I";
	public static final String SYSOBJ_TYPE_TEXT = "T";

	public static final long SYSOBJ_CONSOLE_MENU_OBJ_ID = 2L;

	/**
	 * constants for video auth
	 */
	public static final int VIDEO_AUTH_STATUS_PENDING = 1;
	public static final int VIDEO_AUTH_STATUS_PENDING_PUB = 2;
	public static final int VIDEO_AUTH_STATUS_REJECT = 3;
	public static final int VIDEO_AUTH_STATUS_PUBLISHED = 4;
	public static final int VIDEO_AUTH_STATUS_OFFLINE = 5;
	public static final int VIDEO_AUTH_STATUS_DISABLED = 6;
	public static final int VIDEO_AUTH_STATUS_REMOVED = 7;

	/**
	 * dict domains
	 */
	public static final String DICT_DOMAIN_CHANNEL_PLATE = "CHANNEL_PLATE";
	public static final String DICT_DOMAIN_CHANNEL_TYPE = "CHANNEL_TYPE";
	public static final String DICT_DOMAIN_EDU_STAGE = "EDU_STAGE";
	public static final String DICT_DOMAIN_GENDER_TYPE = "GENDER_TYPE";
	public static final String DICT_DOMAIN_MEETING_STATUS = "MEETING_STATUS";
	public static final String DICT_DOMAIN_MEETING_TYPE = "MEETING_TYPE";
	public static final String DICT_DOMAIN_SHARE_VIDEO_VIEW_LEVEL = "SHARE_VIDEO_VIEW_LEVEL";
	public static final String DICT_DOMAIN_TARGET_ROLE = "TARGET_ROLE";
	public static final String DICT_DOMAIN_USER_EVENT_OPTR_TYPE = "USER_EVENT_OPTR_TYPE";
	public static final String DICT_DOMAIN_VIDEO_AUTH_STATUS = "VIDEO_AUTH_STATUS";
	public static final String DICT_DOMAIN_VIDEO_TYPE = "VIDEO_TYPE";
	public static final String DICT_DOMAIN_MEETING_SERVER_TYPE = "MEETING_SERVER_TYPE";
	public static final String DICT_DOMAIN_REGION = "REGION";
	public static final String DICT_DOMAIN_SCHOOL_TYPE = "SCHOOL_TYPE";
	public static final String DICT_DOMAIN_SCHOOL_GRADE = "SCHOOL_GRADE";

	/**
	 * user events
	 */
	public static final int DSID_USER_EVENT_OPTR_TYPE_UPLOAD = 1;
	public static final int DSID_USER_EVENT_OPTR_TYPE_ADD_FREIND = 2;
	public static final int DSID_USER_EVENT_OPTR_TYPE_ADD_FAV = 3;
	public static final int DSID_USER_EVENT_OPTR_TYPE_SHARE = 4;

	/**
	 * channel type
	 */
	public static final int DSID_CHANNEL_TYPE_NORMAL = 1;
	public static final int DSID_CHANNEL_TYPE_FUNCTION = 2;
	public static final int DSID_CHANNEL_TYPE_VIDEO = 3;
	public static final int DSID_CHANNEL_TYPE_MEETING = 4;

	/**
	 * share view level
	 */
	public static final int DSID_SHARE_VIDEO_VIEW_LEVEL_PRIVATE = 0;
	public static final int DSID_SHARE_VIDEO_VIEW_LEVEL_FREIND = 1;
	public static final int DSID_SHARE_VIDEO_VIEW_LEVEL_CLZ = 4;
	public static final int DSID_SHARE_VIDEO_VIEW_LEVEL_GRADE = 16;
	public static final int DSID_SHARE_VIDEO_VIEW_LEVEL_SCHOOL = 64;
	public static final int DSID_SHARE_VIDEO_VIEW_LEVEL_PUBLIC = 256;

	/***
	 * meeting type
	 */
	public static final int DSID_MEETING_TYPE_ONLINE_TRAINING = 1;
	public static final int DSID_MEETING_TYPE_WEB_CLZ = 2;
	public static final int DSID_MEETING_TYPE_PARENTS_MEETING = 3;
	public static final int DSID_MEETING_TYPE_PARENTS_SURVEY = 4;
	public static final int DSID_MEETING_SERVER_TYPE_VIDEO = 1;
	public static final int DSID_MEETING_SERVER_TYPE_WHITE_BOARD = 2;

	/**
	 * mobile auth
	 */
	public static final int DSID_MOBILE_AUTH_TYPE_FORGOT_PASSWORD = 1;
	public static final int DSID_MOBILE_AUTH_TYPE_ACTIVATE_USER = 2;

}
